<!DOCTYPE html>
<html lang="zh-cn" itemscope itemtype="http://schema.org/WebPage">
  <head>
    

  <meta charset="utf-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

  <title>panda power! - panda power!</title>
  <meta name="author" content="casper chen"/><script type="application/ld+json">
{
    "@context": "http://schema.org",
    "@type": "WebSite",
    "name": "panda power!",
    
    "url": "https:\/\/cyboca.ga"
}
</script><script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "Organization",
  "name": "",
  "url": "https:\/\/cyboca.ga"
  
  
  
  
}
</script>

<meta property="og:title" content="panda power!" />
<meta property="og:image" content="https://cyboca.ga/img/avatar-icon.png" />
<meta property="og:url" content="https://cyboca.ga/" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="panda power!" />

  <meta name="twitter:title" content="panda power!" />
  <meta name="twitter:image" content="https://cyboca.ga/img/avatar-icon.png" />
  <meta name="twitter:card" content="summary" />
  <link href='https://cyboca.ga/img/favicon.ico' rel='icon' type='image/x-icon'/>
  <meta name="generator" content="Hugo 0.58.3" />
  <link rel="alternate" href="https://cyboca.ga/index.xml" type="application/rss+xml" title="panda power!"><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.css" integrity="sha384-9eLZqc9ds8eNjO3TmqPeYcDj8n+Qfa4nuSiGYa6DjLNcv9BtN69ZIulL9+8CqC9Y" crossorigin="anonymous">
  <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous"><link rel="stylesheet" href="https://cyboca.ga/css/main.css" /><link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lora:400,700,400italic,700italic" />
  <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800" />
  <link rel="stylesheet" href="https://cyboca.ga/css/highlight.min.css" /><link rel="stylesheet" href="https://cyboca.ga/css/codeblock.css" /><link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/photoswipe.min.css" integrity="sha384-h/L2W9KefUClHWaty3SLE5F/qvc4djlyR4qY3NUV5HGQBBW7stbcfff1+I/vmsHh" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/default-skin/default-skin.min.css" integrity="sha384-iD0dNku6PYSIQLyfTOpB06F2KCZJAKLOThS5HRe8b3ibhdEQ6eKsFf/EeFxdOt5R" crossorigin="anonymous">



  </head>
  <body>
    <nav class="navbar navbar-default navbar-fixed-top navbar-custom">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#main-navbar">
        <span class="sr-only">切换导航</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="https://cyboca.ga">panda power!</a>
    </div>

    <div class="collapse navbar-collapse" id="main-navbar">
      <ul class="nav navbar-nav navbar-right">
        
          
            <li>
              <a title="文章" href="/categories/">文章</a>
            </li>
          
        
          
            <li>
              <a title="tags" href="/tags/">tags</a>
            </li>
          
        

        

        
      </ul>
    </div>

    
      <div class="avatar-container">
        <div class="avatar-img-border">
          <a title="panda power!" href="https://cyboca.ga">
            <img class="avatar-img" src="https://cyboca.ga/img/avatar-icon.png" alt="panda power!" />
          </a>
        </div>
      </div>
    

  </div>
</nav>




    


<div class="pswp" tabindex="-1" role="dialog" aria-hidden="true">

<div class="pswp__bg"></div>

<div class="pswp__scroll-wrap">
    
    <div class="pswp__container">
      <div class="pswp__item"></div>
      <div class="pswp__item"></div>
      <div class="pswp__item"></div>
    </div>
    
    <div class="pswp__ui pswp__ui--hidden">
    <div class="pswp__top-bar">
      
      <div class="pswp__counter"></div>
      <button class="pswp__button pswp__button--close" title="Close (Esc)"></button>
      <button class="pswp__button pswp__button--share" title="Share"></button>
      <button class="pswp__button pswp__button--fs" title="Toggle fullscreen"></button>
      <button class="pswp__button pswp__button--zoom" title="Zoom in/out"></button>
      
      
      <div class="pswp__preloader">
        <div class="pswp__preloader__icn">
          <div class="pswp__preloader__cut">
            <div class="pswp__preloader__donut"></div>
          </div>
        </div>
      </div>
    </div>
    <div class="pswp__share-modal pswp__share-modal--hidden pswp__single-tap">
      <div class="pswp__share-tooltip"></div>
    </div>
    <button class="pswp__button pswp__button--arrow--left" title="Previous (arrow left)">
    </button>
    <button class="pswp__button pswp__button--arrow--right" title="Next (arrow right)">
    </button>
    <div class="pswp__caption">
      <div class="pswp__caption__center"></div>
    </div>
    </div>
    </div>
</div>


  
  
  






  

  <header class="header-section ">
    
    <div class="intro-header no-img">
      <div class="container">
        <div class="row">
          <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
            <div class="page-heading">
              
                <h1>panda power!</h1>
              
              
                <hr class="small">
              
              
              
            </div>
          </div>
        </div>
      </div>
    </div>
  </header>


    <div id="gotoTop"><a href="#"></a></div>
    
  <div role="main" class="container">
    <div class="row">
      <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
        

        <div class="posts-list">
          
          
            <article class="post-preview">
    <a href="https://cyboca.ga/post/emiya/traefik/">
        <h2 class="post-title">Traefik</h2>
        
        
        
    </a>

    <p class="post-meta">
        <span class="post-meta">
  
  
  <i class="fas fa-calendar"></i>&nbsp;发表于 November 24, 2019
  
  
    &nbsp;|&nbsp;<i class="fas fa-clock"></i>&nbsp;3&nbsp;分钟
  
  
    &nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;430&nbsp;个字
  
  
    
      &nbsp;|&nbsp;<i class="fas fa-user"></i>&nbsp;emiya
    
  
  
</span>


    </p>
    <div class="post-entry">
        
        Traefik部署 需求
   镜像名 版本     traefik v1.65    1、创建rbac授权 [root@node01 traefik]# cat rbac.yaml apiVersion: v1 kind: ServiceAccount metadata: name: traefik-ingress-controller namespace: kube-system --- kind: ClusterRole apiVersion: rbac.authorization.k8s.io/v1beta1 metadata: name: traefik-ingress-controller rules: - apiGroups: - &#34;&#34; resources: - services - endpoints - secrets verbs: - get - list - watch - apiGroups: - extensions resources: - ingresses verbs: - get - list - watch --- kind: ClusterRoleBinding apiVersion: rbac.
        <a href="https://cyboca.ga/post/emiya/traefik/" class="post-read-more">[阅读全文]</a>
        
    </div>

    
    <div class="blog-tags">
        
        <a href="https://cyboca.ga/tags/kubernetes/">Kubernetes</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/traefik/">Traefik</a>&nbsp;
        
    </div>
    

</article>
          
            <article class="post-preview">
    <a href="https://cyboca.ga/post/frank/docker_daemon%E9%85%8D%E7%BD%AE%E5%AE%98%E6%96%B9%E6%96%87%E6%A1%A3%E7%BF%BB%E8%AF%911/">
        <h2 class="post-title">Docker Daemon配置官方文档翻译(1)</h2>
        
        
        
    </a>

    <p class="post-meta">
        <span class="post-meta">
  
  
  <i class="fas fa-calendar"></i>&nbsp;发表于 November 24, 2019
  
  
    &nbsp;|&nbsp;<i class="fas fa-clock"></i>&nbsp;3&nbsp;分钟
  
  
    &nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;599&nbsp;个字
  
  
    
      &nbsp;|&nbsp;<i class="fas fa-user"></i>&nbsp;Frank
    
  
  
</span>


    </p>
    <div class="post-entry">
        
        原文地址
Configure and troubleshoot the Docker daemon  配置和找出错误在Docker daemon上
 (Daemon程序，又称为守护进程，通常在系统后台长时间运行，由于没有控制终端而无法与前台交互，Daemon程序一般作为系统服务使用。)
After successfully installing and starting Docker, the dockerd daemon runs with its default configuration. This topic shows how to customize the configuration, start the daemon manually, and troubleshoot and debug the daemon if you run into issues.
 在成功的安装和启动docker后，docker的守护进程会以它默认的配置文件运行，这个话题会展示如何配置配置文件，手动启动守护进程，和你在遇到错误时找到并解决错误。
 Start the daemon using operating system utilities  启动守护进程通过操作系统程序
 On a typical installation the Docker daemon is started by a system utility, not manually by a user.
        <a href="https://cyboca.ga/post/frank/docker_daemon%E9%85%8D%E7%BD%AE%E5%AE%98%E6%96%B9%E6%96%87%E6%A1%A3%E7%BF%BB%E8%AF%911/" class="post-read-more">[阅读全文]</a>
        
    </div>

    
    <div class="blog-tags">
        
        <a href="https://cyboca.ga/tags/docker/">Docker</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/daemon/">Daemon</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/%E7%BF%BB%E8%AF%91/">翻译</a>&nbsp;
        
    </div>
    

</article>
          
            <article class="post-preview">
    <a href="https://cyboca.ga/post/makemon/kubernetes-components/">
        <h2 class="post-title">k8s官方文档-组件(1.16版)</h2>
        
        
        
    </a>

    <p class="post-meta">
        <span class="post-meta">
  
  
  <i class="fas fa-calendar"></i>&nbsp;发表于 November 18, 2019
  
  
    &nbsp;|&nbsp;<i class="fas fa-clock"></i>&nbsp;5&nbsp;分钟
  
  
    &nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;1042&nbsp;个字
  
  
    
      &nbsp;|&nbsp;<i class="fas fa-user"></i>&nbsp;makemon
    
  
  
</span>


    </p>
    <div class="post-entry">
        
        Kubernetes Components(K8s组件) 原文地址 When you deploy Kubernetes, you get a cluster.
 部署Kubernetes时，您将获得一个集群
 A cluster is a set of machines, called nodes, that run containerized applications managed by Kubernetes. A cluster has at least one worker node and at least one master node.
 集群是一组计算机，称为节点，它们运行由Kubernetes管理的容器化应用程序。集群具有至少一个工作节点和至少一个主节点
 The worker node(s) host the pods that are the components of the application. The master node(s) manages the worker nodes and the pods in the cluster.
        <a href="https://cyboca.ga/post/makemon/kubernetes-components/" class="post-read-more">[阅读全文]</a>
        
    </div>

    
    <div class="blog-tags">
        
        <a href="https://cyboca.ga/tags/kubernetes/">kubernetes</a>&nbsp;
        
    </div>
    

</article>
          
            <article class="post-preview">
    <a href="https://cyboca.ga/post/cxn/cpucontextswitch/">
        <h2 class="post-title">CpuContextSwitch</h2>
        
        
        
    </a>

    <p class="post-meta">
        <span class="post-meta">
  
  
  <i class="fas fa-calendar"></i>&nbsp;发表于 November 17, 2019
  
  
    &nbsp;|&nbsp;<i class="fas fa-clock"></i>&nbsp;3&nbsp;分钟
  
  
    &nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;549&nbsp;个字
  
  
    
      &nbsp;|&nbsp;<i class="fas fa-user"></i>&nbsp;cxn
    
  
  
</span>


    </p>
    <div class="post-entry">
        
        Cpu context switch 查看系统上下文切换情况
过多的上下文切换，会把cpu时间消耗在寄存器、内核栈以及虚拟内存等数据的保存和恢复上，缩短进程真正运行的时间，大大降低了系统性能
vmstat主要用来分析系统内存使用情况，也可以用来分析cpu上下文切换和中断的次数
[root@node001 ~]# vmstat 5 procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- r b swpd free buff cache si so bi bo in cs us sy id wa st 0 0 0 7005360 91564 818900 0 0 0 0 25 33 0 0 100 0 0 我们一起来看这个结果，你可以先试着自己解读每列的含义。在这里，需要特别关注的四列内容：
 cs（context switch）是每秒上下文切换的次数。 in（interrupt）则是每秒中断的次数。 r（Running or Runnable）是就绪队列的长度，也就是正在运行和等待 CPU 的进程数。 b（Blocked）则是处于不可中断睡眠状态的进程数。  可以看到，这个例子中的上下文切换次数 cs 是 33 次，而系统中断次数 in 则是 25 次，而就绪队列长度 r 和不可中断状态进程数 b 都是 0。
        <a href="https://cyboca.ga/post/cxn/cpucontextswitch/" class="post-read-more">[阅读全文]</a>
        
    </div>

    
    <div class="blog-tags">
        
        <a href="https://cyboca.ga/tags/linux/">linux</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/performance-optimization/">Performance optimization</a>&nbsp;
        
    </div>
    

</article>
          
            <article class="post-preview">
    <a href="https://cyboca.ga/post/cxn/devicemapper/">
        <h2 class="post-title">DeviceMapper</h2>
        
        
        
    </a>

    <p class="post-meta">
        <span class="post-meta">
  
  
  <i class="fas fa-calendar"></i>&nbsp;发表于 November 17, 2019
  
  
    &nbsp;|&nbsp;<i class="fas fa-clock"></i>&nbsp;1&nbsp;分钟
  
  
    &nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;154&nbsp;个字
  
  
    
      &nbsp;|&nbsp;<i class="fas fa-user"></i>&nbsp;cxn
    
  
  
</span>


    </p>
    <div class="post-entry">
        
        Docker的DeviceMapper 我们可以看一下docker的loopback设备：
[root@node001 ~]# losetup -a /dev/loop0: [64768]:38050288 (/var/lib/docker/devicemapper/devicemapper/data) /dev/loop1: [64768]:38050289 (/var/lib/docker/devicemapper/devicemapper/metadata) 其中data 100GB，metadata 2.0GB
[root@node001 ~]# ls -alhs /var/lib/docker/devicemapper/devicemapper 506M -rw-------. 1 root root 100G Sep 10 20:15 data 1.1M -rw-------. 1 root root 2.0G Sep 10 20:15 metadata 下面是相关的thin-pool。其中，有个当一大串hash串的device是正在启动的容器：
[root@node001 ~]# ll /dev/mapper/dock* lrwxrwxrwx. 1 root root 7 Aug 25 07:57 /dev/mapper/docker-253:0-104108535-pool -&gt; ../dm-2 lrwxrwxrwx. 1 root root 7 Aug 25 11:13 /dev/mapper/docker-253:0-104108535-deefcd630a60aa5ad3e69249f58a68e717324be4258296653406ff062f605edf -&gt; ../dm-3 我们可以看一下它的device id（Docker都把它们记下来了）：
        <a href="https://cyboca.ga/post/cxn/devicemapper/" class="post-read-more">[阅读全文]</a>
        
    </div>

    
    <div class="blog-tags">
        
        <a href="https://cyboca.ga/tags/linux/">linux</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/docker/">docker</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/device-mapper/">Device Mapper</a>&nbsp;
        
    </div>
    

</article>
          
            <article class="post-preview">
    <a href="https://cyboca.ga/post/cxn/thinprovisioningsnapshot/">
        <h2 class="post-title">Thin Provisioning</h2>
        
        
        
    </a>

    <p class="post-meta">
        <span class="post-meta">
  
  
  <i class="fas fa-calendar"></i>&nbsp;发表于 November 17, 2019
  
  
    &nbsp;|&nbsp;<i class="fas fa-clock"></i>&nbsp;3&nbsp;分钟
  
  
    &nbsp;|&nbsp;<i class="fas fa-book"></i>&nbsp;511&nbsp;个字
  
  
    
      &nbsp;|&nbsp;<i class="fas fa-user"></i>&nbsp;cxn
    
  
  
</span>


    </p>
    <div class="post-entry">
        
        Thin Provisioning Snapshot 演示 下面，我们用一系列的命令来演示一下Device Mapper的Thin Provisioning Snapshot是怎么玩的。
首先，我们需要先建两个文件，一个是data.img，一个是meta.data.img：
[root@node001 ~]# dd if=/dev/zero of=/tmp/data.img bs=1K count=1 seek=10M 1+0 records in 1+0 records out 1024 bytes (1.0 kB) copied, 0.000621428 s, 1.6 MB/s [root@node001 ~]# dd if=/dev/zero of=/tmp/meta.data.img bs=1K count=1 seek=1G 1+0 records in 1+0 records out 1024 bytes (1.0 kB) copied, 0.000140858 s, 7.3 MB/s 注意命令中seek选项，其表示为略过of选项指定的输出文件的前10G个output的bloksize的空间后再写入内容。因为bs是1个字节，所以也就是10G的尺寸，但其实在硬盘上是没有占有空间的，占有空间只有1k的内容。当向其写入内容时，才会在硬盘上为其分配空间。我们可以用ls命令看一下，实际分配了12K和4K。
[root@node001 ~]# ls -lsh /tmp/data.img 12K -rw-r--r--. 1 root root 11G Aug 25 23:01 /tmp/data.
        <a href="https://cyboca.ga/post/cxn/thinprovisioningsnapshot/" class="post-read-more">[阅读全文]</a>
        
    </div>

    
    <div class="blog-tags">
        
        <a href="https://cyboca.ga/tags/linux/">linux</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/docker/">docker</a>&nbsp;
        
        <a href="https://cyboca.ga/tags/thin-provisioning/">Thin Provisioning</a>&nbsp;
        
    </div>
    

</article>
          
        </div>

        
          <ul class="pager main-pager">
            
              <li class="previous">
                <a href="https://cyboca.ga/page/1/">&larr; 上一页</a>
              </li>
            
            
              <li class="next">
                <a href="https://cyboca.ga/page/3/">下一页 &rarr;</a>
              </li>
            
          </ul>
        
      </div>
    </div>
  </div>

      
    <div class="page-meta">
  
  
  
</div>


  
<footer>
  <div class="container">
    <div class="row">
      <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
        <ul class="list-inline text-center footer-links">
          
          
          <li>
            <a href="/index.xml" title="RSS">
              <span class="fa-stack fa-lg">
                <i class="fas fa-circle fa-stack-2x"></i>
                <i class="fas fa-rss fa-stack-1x fa-inverse"></i>
              </span>
            </a>
          </li>
          
        </ul>
        <p class="credits copyright text-muted">
          
            
              <a href="example.com">casper chen</a>
            
          

          &nbsp;&bull;&nbsp;&copy;
          
            2019
          

          
            &nbsp;&bull;&nbsp;
            <a href="https://cyboca.ga">panda power!</a>
          
        </p>
        
        <p class="credits theme-by text-muted">
          由 <a href="https://gohugo.io">Hugo v0.58.3</a> 强力驱动 &nbsp;&bull;&nbsp; 主题 <a href="https://github.com/halogenica/beautifulhugo">Beautiful Hugo</a> 移植自 <a href="https://deanattali.com/beautiful-jekyll/">Beautiful Jekyll</a>
          
        </p>
      </div>
    </div>
  </div>
</footer><script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/katex.min.js" integrity="sha384-K3vbOmF2BtaVai+Qk37uypf7VrgBubhQreNQe9aGsz9lB63dIFiQVlJbr92dw2Lx" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.10.0/contrib/auto-render.min.js" integrity="sha384-kmZOZB5ObwgQnS/DuDg6TScgOiWWBiVt0plIRkZCmE6rDZGrEOQeHM5PcHi+nyqe" crossorigin="anonymous"></script>
<script src="https://code.jquery.com/jquery-1.12.4.min.js" integrity="sha256-ZosEbRLbNQzLpnKIkEdrPv7lOy9C27hHQ+Xp8a4MxAQ=" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<script src="https://cyboca.ga/js/main.js"></script>
<script src="https://cyboca.ga/js/highlight.min.js"></script>
<script> hljs.initHighlightingOnLoad(); </script>
<script> $(document).ready(function() {$("pre.chroma").css("padding","0");}); </script><script> renderMathInElement(document.body); </script><script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/photoswipe.min.js" integrity="sha384-QELNnmcmU8IR9ZAykt67vGr9/rZJdHbiWi64V88fCPaOohUlHCqUD/unNN0BXSqy" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/photoswipe/4.1.2/photoswipe-ui-default.min.js" integrity="sha384-m67o7SkQ1ALzKZIFh4CiTA8tmadaujiTa9Vu+nqPSwDOqHrDmxLezTdFln8077+q" crossorigin="anonymous"></script><script src="https://cyboca.ga/js/load-photoswipe.js"></script>









    
  </body>
</html>

